
package com.yuhanginfo.modules.sys.entity;

import org.hibernate.validator.constraints.Length;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;
import com.yuhanginfo.modules.sys.entity.User;

import com.yuhanginfo.common.persistence.DataEntity;
import com.yuhanginfo.common.utils.excel.annotation.ExcelField;

/**
 * 订单管理Entity
 * @author yangs
 * @version 2017-09-18
 */
public class Orders extends DataEntity<Orders> implements Cloneable {
	public static final Logger logger =  LoggerFactory.getLogger(Orders.class);
	private static final long serialVersionUID = 1L;
	

	
	
	
	
	private String code;		// 订单号
	private String changeCode;
	private String payType;		// 支付方式:0现金,1账期
	private String state;		// 订单状态：1代付款，2待发货，3部分发货，4全部发货，5已完成，6已取消，7异常
	private String historyState;		// 订单异常之前的状态
	private String buyStoreName;		// 门店名称
	private String buyStoreCode;		// 门店号
	private Date payDate;		// 下单时间
	private User user;		// 会员id
	private String sysUserId;		// 业务员id
	private String money;		// 订单金额
	private String modifyMoney;
	private String payMoney;		// 付款金额
	private String transportType;		// 物流方式
	private String freight;		// 运费
	private String modifyFreight;
	private String receiveName;		// 收货人
	private String receivePhone;		// 收货地电话
	private String receiveAddress;		// 收货地址
	private String isHistory;		// 是否历史:0否，1是
	private String sysUserName; 
	private String userType;
	private String userName;
	private String userCompany;
	private String suoStore;
	private String suoYe;
	private String goodsCnName;
	private String partsCode;
	private String num;
	private String xiaYeUser;
	private String type;
	private Date startTime;
	private Date endTime;
	private String goodsTotalMoney;
	private String fpReceiveName;
	private String fpReceivePhone;
	private String fpReceiveAddress;
	private String  dutyCode;
	private String company;
	private String payCode;
	private String orderType;
	private String invoiceTitle;
	private Date starPayDate;
	private Date endPayDate;
	private Date starUpdateDate;
	private Date endUpdateDate;
	private Date sendFinishTime;//发货完成时间
	private String payNo;//支付流水号
    private String userId;
    private String ppType;//匹配方式
	private String price;
	
	public Orders clone(){
		try{
		return (Orders)super.clone();
		}catch(Exception ex){
			logger.debug("",ex);
			return null;
		}
	}
    
	
	public Orders() {
		super();
	}

	public Orders(String id){
		super(id);
	}
    
	@ExcelField(title="数量", align=4, sort=13)
	public String getNum() {
		return num;
	}

	public void setNum(String num) {
		this.num = num;
	}
	@ExcelField(title="单价", align=4, sort=12)
	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}


	
	
	@ExcelField(title="配件号", align=4, sort=11)
	public String getPartsCode() {
		return partsCode;
	}

	public void setPartsCode(String partsCode) {
		this.partsCode = partsCode;
	}

	@ExcelField(title="商品名", align=4, sort=4)
	public String getGoodsCnName() {
		return goodsCnName;
	}

	public void setGoodsCnName(String goodsCnName) {
		this.goodsCnName = goodsCnName;
	}



	public String getPpType() {
		return ppType;
	}

	public void setPpType(String ppType) {
		this.ppType = ppType;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getGoodsTotalMoney() {
		return goodsTotalMoney;
	}

	public void setGoodsTotalMoney(String goodsTotalMoney) {
		this.goodsTotalMoney = goodsTotalMoney;
	}

	public String getFpReceiveName() {
		return fpReceiveName;
	}

	public void setFpReceiveName(String fpReceiveName) {
		this.fpReceiveName = fpReceiveName;
	}

	public String getFpReceivePhone() {
		return fpReceivePhone;
	}

	public void setFpReceivePhone(String fpReceivePhone) {
		this.fpReceivePhone = fpReceivePhone;
	}

	public String getFpReceiveAddress() {
		return fpReceiveAddress;
	}

	public void setFpReceiveAddress(String fpReceiveAddress) {
		this.fpReceiveAddress = fpReceiveAddress;
	}

	public String getDutyCode() {
		return dutyCode;
	}

	public void setDutyCode(String dutyCode) {
		this.dutyCode = dutyCode;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getPayCode() {
		return payCode;
	}

	public void setPayCode(String payCode) {
		this.payCode = payCode;
	}
	
	public String getSysUserName() {
		return sysUserName;
	}

	public void setSysUserName(String sysUserName) {
		this.sysUserName = sysUserName;
	}
	@ExcelField(title="用户类型", align=2, sort=12, dictType="user_type")
	public String getUserType() {
		return userType;
	}


	public void setUserType(String userType) {
		this.userType = userType;
	}

	@ExcelField(title="下单用户", align=2, sort=5)
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@ExcelField(title="所属门店", align=1, sort=9)
	public String getSuoStore() {
		return suoStore;
	}

	public void setSuoStore(String suoStore) {
		this.suoStore = suoStore;
	}
	@ExcelField(title="所属业务员", align=1, sort=7)
	public String getSuoYe() {
		return suoYe;
	}

	public void setSuoYe(String suoYe) {
		this.suoYe = suoYe;
	}
	@ExcelField(title="下单业务员", align=2, sort=10)
	public String getXiaYeUser() {
		return xiaYeUser;
	}

	public void setXiaYeUser(String xiaYeUser) {
		this.xiaYeUser = xiaYeUser;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}



	@ExcelField(title="订单号", align=5, sort=1)
	@Length(min=0, max=30, message="订单号长度必须介于 0 和 30 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Length(min=0, max=11, message="支付方式:0现金,1账期长度必须介于 0 和 11 之间")
	public String getPayType() {
		return payType;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}
	
	@Length(min=0, max=11, message="订单状态：1代付款，2待发货，3部分发货，4全部发货，5已完成，6已取消，7异常长度必须介于 0 和 11 之间")
	@ExcelField(title="订单状态", align=2, sort=11, dictType="orders_state")
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	@Length(min=0, max=11, message="订单异常之前的状态长度必须介于 0 和 11 之间")
	public String getHistoryState() {
		return historyState;
	}

	public void setHistoryState(String historyState) {
		this.historyState = historyState;
	}
	@ExcelField(title="下单门店",  align=1, sort=6)
	@Length(min=0, max=50, message="门店名称长度必须介于 0 和 50 之间")
	public String getBuyStoreName() {
		return buyStoreName;
	}

	public void setBuyStoreName(String buyStoreName) {
		this.buyStoreName = buyStoreName;
	}
	
	@Length(min=0, max=50, message="门店号长度必须介于 0 和 50 之间")
	public String getBuyStoreCode() {
		return buyStoreCode;
	}

	public void setBuyStoreCode(String buyStoreCode) {
		this.buyStoreCode = buyStoreCode;
	}
	
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="下单时间",type=1, align=2, sort=2)
	@NotNull(message="下单时间不能为空")
	public Date getPayDate() {
		return payDate;
	}

	public void setPayDate(Date payDate) {
		this.payDate = payDate;
	}
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@Length(min=0, max=64, message="业务员id长度必须介于 0 和 64 之间")
	public String getSysUserId() {
		return sysUserId;
	}

	public void setSysUserId(String sysUserId) {
		this.sysUserId = sysUserId;
	}
	@ExcelField(title="订单金额",  align=1, sort=8)
	public String getMoney() {
		return money;
	}

	public void setMoney(String money) {
		this.money = money;
	}
	
	public String getPayMoney() {
		return payMoney;
	}

	public void setPayMoney(String payMoney) {
		this.payMoney = payMoney;
	}
	
	@Length(min=0, max=11, message="物流方式长度必须介于 0 和 11 之间")
	public String getTransportType() {
		return transportType;
	}

	public void setTransportType(String transportType) {
		this.transportType = transportType;
	}
	
	public String getFreight() {
		return freight;
	}

	public void setFreight(String freight) {
		this.freight = freight;
	}
	
	@Length(min=0, max=50, message="收货人长度必须介于 0 和 50 之间")
	public String getReceiveName() {
		return receiveName;
	}

	public void setReceiveName(String receiveName) {
		this.receiveName = receiveName;
	}
	
	@Length(min=0, max=13, message="收货地电话长度必须介于 0 和 13 之间")
	public String getReceivePhone() {
		return receivePhone;
	}

	public void setReceivePhone(String receivePhone) {
		this.receivePhone = receivePhone;
	}
	
	@Length(min=0, max=500, message="收货地址长度必须介于 0 和 500 之间")
	public String getReceiveAddress() {
		return receiveAddress;
	}

	public void setReceiveAddress(String receiveAddress) {
		this.receiveAddress = receiveAddress;
	}
	
	@Length(min=0, max=11, message="是否历史:0否，1是长度必须介于 0 和 11 之间")
	public String getIsHistory() {
		return isHistory;
	}

	public void setIsHistory(String isHistory) {
		this.isHistory = isHistory;
	}

	public Date getStarPayDate() {
		return starPayDate;
	}

	public void setStarPayDate(Date starPayDate) {
		this.starPayDate = starPayDate;
	}

	public Date getEndPayDate() {
		return endPayDate;
	}

	public void setEndPayDate(Date endPayDate) {
		this.endPayDate = endPayDate;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getSendFinishTime() {
		return sendFinishTime;
	}

	public void setSendFinishTime(Date sendFinishTime) {
		this.sendFinishTime = sendFinishTime;
	}

	public String getChangeCode() {
		return changeCode;
	}

	public void setChangeCode(String changeCode) {
		this.changeCode = changeCode;
	}

	public String getModifyMoney() {
		return modifyMoney;
	}

	public void setModifyMoney(String modifyMoney) {
		this.modifyMoney = modifyMoney;
	}
	
	
	public String getModifyFreight() {
		return modifyFreight;
	}

	public void setModifyFreight(String modifyFreight) {
		this.modifyFreight = modifyFreight;
	}



	public String getUserCompany() {
		return userCompany;
	}

	public void setUserCompany(String userCompany) {
		this.userCompany = userCompany;
	}

	public String getOrderType() {
		return orderType;
	}

	public void setOrderType(String orderType) {
		this.orderType = orderType;
	}

	public String getInvoiceTitle() {
		return invoiceTitle;
	}

	public void setInvoiceTitle(String invoiceTitle) {
		this.invoiceTitle = invoiceTitle;
	}

	public String getPayNo() {
		return payNo;
	}

	public void setPayNo(String payNo) {
		this.payNo = payNo;
	}

	public Date getStarUpdateDate() {
		return starUpdateDate;
	}

	public void setStarUpdateDate(Date starUpdateDate) {
		this.starUpdateDate = starUpdateDate;
	}

	public Date getEndUpdateDate() {
		return endUpdateDate;
	}

	public void setEndUpdateDate(Date endUpdateDate) {
		this.endUpdateDate = endUpdateDate;
	}
	
}